//
//  Constant.h
//  ShangWuTong
//
//  Created by 孙家文 on 16/4/8.
//  Copyright © 2016年 zjwy. All rights reserved.
//

#ifndef Constant_h
#define Constant_h
/**
 *  RGB
 */
#define RGBCOLOR(r,g,b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1]
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
/**
 *  View尺寸
 */
#define kScreenHeight [UIScreen mainScreen].bounds.size.height
#define kScreenWidth [UIScreen mainScreen].bounds.size.width

// 弱引用
#define WEAKSELF __weak typeof(self) weakSelf = self;

//按比例获取高度
#define  WGiveHeight(HEIGHT) HEIGHT * [UIScreen mainScreen].bounds.size.height/568.0
//按比例获取宽度
#define  WGiveWidth(WIDTH) WIDTH * [UIScreen mainScreen].bounds.size.width/320.0
/**
 *  系统版本
 */
#define iOS8Later [[[UIDevice currentDevice]systemVersion] floatValue] >= 8.0
#define iOS11Later [[[UIDevice currentDevice]systemVersion] floatValue] >= 11.0

#define iOS7Lower [[[UIDevice currentDevice]systemVersion] floatValue] < 7.0

/**
 *  方法
 */
// 提示
#define ShowAlert(title) {UIAlertView * alert = [[UIAlertView alloc]initWithTitle:nil message:title delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil];[alert show];}

/**
 *  颜色
 */
//#define  MainTextColor RGBCOLOR(46, 46, 46)// 主要黑色类字体颜色
#define  NavigationBarTintColor UIColorFromRGB(0xFDFCFC)
//#define  TitleColor UIColorFromRGB(0xea6e48)
//#define  MainBlueColor UIColorFromRGB(0xea6e48)

#define  TitleColor UIColorFromRGB(0x0099CC)
#define  MainBlueColor UIColorFromRGB(0x0099CC)

//RGBCOLOR(248,78,45)//UIColorFromRGB(0x0099CC)

/**
 *  默认字体尺寸
 */
#define defaultFont (kScreenHeight > 568 ? 15.0f : 13.0f)
#define CalendarTitleFont 20.0f
#define animationDurations 0.2

#define calendarHeight WGiveHeight(350)

/**
 *  一个倒班周期最大天数
 */
#define MAX_TURN_PERIOD 20
/**
 *  沙盒目录
 */
#define DOCUMENTS_DIRECTORY [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]


#endif /* Constant_h */
